package com.moneywelcome.goldassembly.apiImpl;

import com.moneywelcome.annnotation.RedisAnnotation;
import com.moneywelcome.goldassembly.service.GoldTrendService;
import com.moneywelcome.goldfacade.GoldOperationApi;
import com.moneywelcome.goldfacade.dto.GoldTrendDto;
import com.moneywelcome.goldfacade.vo.GoldTrendVo;
import com.moneywelcome.results.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class GoldOperationApiImpl implements GoldOperationApi {
    @Autowired
    private GoldTrendService gts;
    @Override
    @RedisAnnotation(read = false,refresh = "com.moneywelcome.goldassembly.apiImpl.GoldQueryApiImpl.queryTrendDay")
    public Result<GoldTrendDto> saveTrend(GoldTrendVo goldTrendVo) {
      log.info("保存当天走势{}",goldTrendVo);
        return Result.success(gts.create(goldTrendVo));
    }
}
